<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<s:head/>
		<s:i18n name="globalMessages"></s:i18n>	
		<base href="<%=basePath %>" />
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
		<title>上传个性LOGO</title>
		<link href="main/css/right.css" rel="stylesheet" type="text/css" />
		<script type='text/javascript' src='js/jquery-1.4.2.min.js'></script>
		<script type='text/javascript' src='js/jquery.validate.min.js'></script>
		<script type='text/javascript' src='js/common.js'></script>
		<script type="text/javascript">
			//初始化验证
			$().ready(function() {
				$("#addForm").validate({
					rules : {
						pic: {
							required:true,
							accept:true							
						}
					},
					messages : {
						pic : {
							required: "请选择要上传的图片",
							accept: "请选择正确的文件格式"
						}
					}
				});
			});
		</script>
	</head>
	<body>
		<div align="center">
			<!--头部-->
			<s:include value="/main/top.jsp" />
		</div>
		<!--中间-->
		<table  border="0" align="center"  width="1257">
			<tr>
				<!--左边-->
				<td width="165" height="501" valign="top">
					<div id="leftdiv">
						<s:include value="/main/leftMenu.jsp" />
					</div>
				</td>
				<!--右边-->
				<td align="left" class="right">
					<div>
						<div class="right_title">
							<s:if test="#session.userObject.dictRoles.name=='个人会员'">
								上传图片
							</s:if>
							<s:else>
								上传个性LOGO 
							</s:else>
						</div>
						<s:form name="addForm" id="addForm" action="companyLogoUpload!uploadEnterpriseLogo.action" enctype="multipart/form-data" method="post">
							<table  >
								<tr>
									<td width="250px" height="28" align="right" style="color: #000066">
										<s:if test="#session.userObject.dictRoles.name=='个人会员'">
											上传照片:
										</s:if>
										<s:else>
											上传图片: 
										</s:else>
									</td>
									<td>
										<input type="file" name="pic" size="50" accept="image/gif,jpg" />
									</td>
								</tr>
								<tr>
									<td   height="45" align="right">
										&nbsp;
									</td>
									<td width="812">
										<font color="red">
											1、图片只能为gif或jpg格式，个性LOGO不能大于1M。<br />
											2、如果之前您已经上传了图片，再次上传即更新以前的图片。
										</font>
									</td>
								</tr>
								<tr>
									<td height="23" align="right">
										&nbsp;
									</td>
									<td>
										<s:if test="#session.userObject.dictRoles.name=='个人会员'">
											<input type="submit" name="" value="保存照片 " class="button" />
										</s:if>
										<s:else>
											<input type="submit" name="" value="保存图片 " class="button" />
										</s:else>
										
									</td>
								</tr>
								<tr>
									<td>&nbsp;</td>
									<td align="left" style="color: red;">
										<s:actionerror/>
									</td>
								</tr>
								<s:if test="#session.userObject.userLogo != null && #session.userObject.userLogo!=''">
								<tr>
									<td  align="right" valign="top" nowrap="nowrap">
										<s:if test="#session.userObject.dictRoles.name=='个人会员'">
											已上传的照片:
										</s:if>
										<s:else>
											已上传的LOGO: 
										</s:else>
									</td>
									<td >
											<img style="max-width: 240px;max-height: 240px;"  src="<s:property value="#session.userObject.userLogo"/>" alt="" />
									</td>
								</tr>
								</s:if>
							</table>
						</s:form>
					</div>
				</td>
			</tr>
		</table>
		<!--底部-->
		<div align="center">
			<s:include value="/main/bottom.jsp" />
		</div>
	</body>
</html>


